//package cn.itcast.es.config;
//
//import org.apache.http.HttpHost;
//import org.elasticsearch.client.RestClient;
//import org.elasticsearch.client.RestHighLevelClient;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
//import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
//
///**
// * Created by bothin
// * At 2020/4/5 15:28
// * Description:
// */
//@Configuration
//@EnableElasticsearchRepositories
//public class ElasticsearchConfig {
//    @Bean(destroyMethod = "close")
//    public RestHighLevelClient client() {
//
//        RestHighLevelClient esClient = new RestHighLevelClient(
//                RestClient.builder(new HttpHost("123.56.12.216", 9200,null)));
//        return esClient;
//    }
//
//    @Bean
//    ElasticsearchRestTemplate elasticsearchTemplate() {
//        return new ElasticsearchRestTemplate(client());
//    }
//}
